package com.lh.item.api;

import com.lh.item.pojo.SpecGroup;
import com.lh.item.pojo.SpecParam;
import com.lh.item.pojo.SpuDo;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 商品相关api，用于开放给外部module使用
 *
 * @author liuhe
 * @date 2020/06/24
 */
@RequestMapping("spec")
public interface SpecificationApi {

    @GetMapping("groups/{cid}")
    List<SpecGroup> querySpecGroupsByCid(@PathVariable("cid") Long cid);

    @GetMapping("/params")
    List<SpecParam> querySpecParam(
            @RequestParam(value = "gid", required = false) Long gid,
            @RequestParam(value = "cid", required = false) Long cid,
            @RequestParam(value = "searching", required = false) Boolean searching,
            @RequestParam(value = "generic", required = false) Boolean generic);

    // 查询规格参数组，及组内参数
    @GetMapping("{cid}")
    List<SpecGroup> querySpecsByCid(@PathVariable("cid") Long cid);

}
